
const { createProxyMiddleware } = require('http-proxy-middleware');
 
module.exports = function(app) {
    app.use(createProxyMiddleware("/api", {
        target: "http://web.juhe.cn" , //配置你要请求的服务器地址
        changeOrigin: true,
        pathRewrite: {
            "^/api": "", //通过pathRewrite重写地址，将前缀/api转为/
        },
    }))
    app.use(createProxyMiddleware("/Ajax", {
        target: "http://apis.juhe.cn" ,
        changeOrigin: true,
        pathRewrite: {
            "^/Ajax": "", //通过pathRewrite重写地址，将前缀/api转为/
        },
    }))
};
